load("@rules_cc//cc:defs.bzl", "cc_library")
load("//:gen_test_targets.bzl", "gen_test_targets")

cc_library(
    name = "boost.heap",
    hdrs = glob(["include/**/*.hpp"]),
    features = ["parse_headers"],
    includes = ["include"],
    visibility = ["//visibility:public"],
    deps = [
        "@boost.array",
        "@boost.assert",
        "@boost.bind",
        "@boost.concept_check",
        "@boost.config",
        "@boost.core",
        "@boost.intrusive",
        "@boost.iterator",
        "@boost.parameter",
        "@boost.static_assert",
        "@boost.throw_exception",
        "@boost.type_traits",
    ],
)

cc_library(
    name = "boost.heap_test_lib",
    testonly = True,
    srcs = glob(["test/**/*_tests.cpp"]),
    hdrs = glob(["test/**/*_tests.hpp"]),
    deps = [
        ":boost.heap",
        "@boost.container",
        "@boost.foreach",
        "@boost.test//:unit_test_main",
    ],
)

gen_test_targets(
    name = "gen_boost.heap_test_targets",
    cc_srcs = glob(
        ["test/*_test.cpp"],
        exclude = [
            # We don't need this test for Bazel as the parse_headers feature
            # already checks that headers are self-contained.
            "test/self_contained_header.cpp",
        ],
    ),
    header_srcs = glob(["test/*.hpp"]),
)
